package cc.iotkit.data.model;

import cc.iotkit.common.tenant.dao.TenantAware;
import cc.iotkit.common.tenant.listener.TenantListener;
import io.github.linpeilie.annotations.AutoMapper;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.Filter;
import org.hibernate.annotations.FilterDef;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.ParamDef;

import javax.persistence.*;

@Data
@Entity
@ApiModel(value = "微自然设备群组详情")
@Table(name = "wzr_group_device_info")
@AutoMapper(target = TbWzrGroupDeviceInfo.class)
@FilterDef(name = "tenantFilter", parameters = {@ParamDef(name = "tenantId", type = "long")})
@Filter(name = "tenantFilter", condition = "tenant_id = :tenantId")
@EntityListeners(TenantListener.class)
public class  TbWzrGroupDeviceInfo extends BaseEntity implements TenantAware {
    @Id
    @GeneratedValue(generator = "SnowflakeIdGenerator")
    @GenericGenerator(name = "SnowflakeIdGenerator", strategy = "cc.iotkit.data.config.id.SnowflakeIdGenerator")
    @ApiModelProperty(value = "列表id")
    private long id;
    /**
     * 所属平台用户ID
     */
    private String uid;
    private Long tenantId;
    @ApiModelProperty("群组id")
    private String groupId;
    @ApiModelProperty("网关id")
    private String gwId;
    @ApiModelProperty("网关设备号")
    private String gwSkName;
    @ApiModelProperty("非网关或子设备号")
    private String devName;
    @ApiModelProperty("设备的id")
    private String devid;
}
